package com.tt.fashionWebSite.domain;

import javax.persistence.*;
import java.io.Serializable;

@SuppressWarnings("serial")
@Entity
@Table(name = "chi_tiet_km")
@NamedQueries({
        @NamedQuery(name = "getDealDetailCommon", query = "SELECT c FROM ChiTietKhuyenMai c") ,
        @NamedQuery(name = "getSearchDealDetailOfId",query = "SELECT s FROM ChiTietKhuyenMai s " +
                "WHERE s.khuyenMai.maKM = :dealId " ) ,
})
public class ChiTietKhuyenMai implements Serializable {

    public static final String GET_DEALDETAIL_ALL = "getDealDetailCommon";
    public static final String GET_SEARCH_DEALDETAIL_OF_ID = "getSearchDealDetailOfId";

   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   @Column(name = "MA_CT_KM")
   private String maCTKM;

   @ManyToOne
   @JoinColumn(name = "MA_KM")
   private KhuyenMai khuyenMai;

   @ManyToOne
   @JoinColumn(name = "MA_CT_SP")
   private ChiTietSanPham chiTietSanPham;

   @Column(name = "PT_GIA_KHUYEN_MAI")
   private Float phanTram;

   public String getMaCTKM() {
      return maCTKM;
   }

   public void setMaCTKM(String maCTKM) {
      this.maCTKM = maCTKM;
   }

   public KhuyenMai getKhuyenMai() {
      return khuyenMai;
   }

   public void setKhuyenMai(KhuyenMai khuyenMai) {
      this.khuyenMai = khuyenMai;
   }

   public ChiTietSanPham getChiTietSanPham() {
      return chiTietSanPham;
   }

   public void setChiTietSanPham(ChiTietSanPham chiTietSanPham) {
      this.chiTietSanPham = chiTietSanPham;
   }

   public Float getPhanTram() {
      return phanTram;
   }

   public void setPhanTram(Float phanTram) {
      this.phanTram = phanTram;
   }
}
